<%--
    fileName      : /sealrecord/sealrecord.jsp
    author        : lenovo
    createDate    : 2016-08-02 08:31:51
    lastModifier  : lenovo
    lastModifyDate: 2016-08-02 08:31:51
    description   : provType=0101 办公职场租赁用印申请流程 provType=0111 招聘合同用印申请流程  provType=0110 ---非合同类用印申请流程
                    provType=0109 一般商务合同服务协议用印申请流程  provType=0108 ---证照公章外借使用申请流程  provType=0107客服部客户信息或收益权变更审批流程 
                    provType=0105 ---运营部用印申请流程  provType=0106 ---产品部对账用印申请流程  provType=0104产品类用印申请流程 
                    provType=0103 电子设备及软件系统采购用印申请流程  provType=0102一般固定资产采购用印申请流程 
--%>
<%@ page language='java' contentType='text/html; charset=UTF-8' pageEncoding='UTF-8' %>
<%@ taglib uri='ctp-tag' prefix='ctp' %>
<%@ page import="com.icbc.cte.base.CTEConstance"%>
<%
	String file_visit_path = "";
	String file_save_path = "";
	try {
		file_visit_path = CTEConstance.getEnvProperty("file_visit_path");
		file_save_path = CTEConstance.getEnvProperty("file_save_path");
	} catch (Exception e) {
		file_visit_path = "";
		file_save_path = "";
	} 
%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title></title>

        <ctp:include items='public,validator,messagebox,borderlayout,grid,menus,panel,toolbar,label,form,gridlayout,checkboxgroup,button,textfield,link,combobox,checkbox,textarea,datepicker,radiogroup'/>

        <script type='text/javascript' kind='variant'>

            var sealrecordPanel;
            var sealrecordLayout;
            var sealrecordForm;
            var _data;
            var flag ='<ctp:out name="flag"/>';
            var type ='<ctp:out name="provType"/>';
            //var oaapplyrecordbasicRecId;
            var oaapplyrecordbasicRecTitle;
            var oaapplyrecordbasicAppType;
            var oaapplyrecordbasicApply;
            var oaapplyrecordbasicComp;
            var oaapplyrecordbasicOrg;
            var oaapplyrecordbasicAppDate;
            var oaapplyrecordbasicIsfile;
            var oaapplyrecordbasicComment;
            var oaapplyrecordbasicTitle;
            var oaapplyrecordbasicCont;
            var oaapplyrecordbasicDesign;
            var oaapplyrecordbasicMethod;
            var oaapplyrecordbasicEmergency;
            var oaapplyrecordbasicAnnexe;
            var oaapplyrecordbasicStatus;
            var oaapplyrecordbasicCreateUser;
            var oaapplyrecordbasicCreateDate;
            var oaapplyrecordbasicUpdateUser;
            var oaapplyrecordbasicUpdateDate;
            var oaapplyrecordbasicIsdel;
            var oaapplyrecordbasicDictId;
            var oasealrecordSealId;
            var oasealrecordRecId;
            var oasealrecordSealType;
            var oasealrecordUseDate;
            var oasealrecordContent;
            var oasealrecordUsage;
            var oasealrecordDownload;
            var oasealrecordAcrossPage;
            var oasealrecordAnnexe;
            var oasealrecordCapture;
            var oasealrecordFinalAnn;
            
            var ifneedReturn;//是否需要归还
            var returndate;//预计归还日期
            
            var headerFiles;
            var proToolbarFiles;
            var dataGridFiles;

            var headerAnn;
            var proToolbarAnn;
            var dataGridAnn;


            var headerCap;
            var proToolbarCap;
            var dataGridCap;
            var v_ret_recId;
            var flagisup;

            
            var applyRemark;
            var validateArray=new Array();
            var formValidator;
            var submitflag;
            var procDefName;
            var procInstName;
            var procInstDesc;
            var veryfyData=[];

            var v_ret_recId = '<ctp:out name="oaapplyrecordbasicRecId"/>';
            var content;
            var fileFlag = '<ctp:out name="fileFlag"/>';//1:详细页面打开最终附件 可上传 删除

            var ctpToolbar;
           
        </script>
        <script type='text/javascript' kind='event'>

        /*
         * @method setValue
         * @desc 设置组件值
         * @author lenovo
         */        
        function init(){
            var _fnContext = "sealrecorddetail.jsp -> init();";
            try {
                if(type=='0101'){

                	veryfyData=[{"gridx":"dataGridAnn","alertMsg":"请上传附件（初稿）"},
								{"gridx":"dataGridCap","alertMsg":"请上传职场租赁装修申请审批截图"}
					];
		            
                }else if (type == '0102'){
                	//sealrecordLayout.getLabelObj('oasealrecord_download_label').hide();
                	//oasealrecordDownload.hide();
                	sealrecordLayout.getLabelObj('oasealrecord_capture_label').setText('<span style="color:red;">*</span>'+"固定资产采购申请审批截图: ");
                	
                	veryfyData=[{"gridx":"dataGridAnn","alertMsg":"请上传附件（初稿）"},
								{"gridx":"dataGridCap","alertMsg":"请上传固定资产采购申请审批截图"}
					];
                }else if (type == '0103'){
                	sealrecordLayout.getLabelObj('oasealrecord_capture_label').setText('<span style="color:red;">*</span>'+"设备及软件设备申请审批截图: ");
                	
                	veryfyData=[{"gridx":"dataGridAnn","alertMsg":"请上传附件（初稿）"},
								{"gridx":"dataGridCap","alertMsg":"请上传设备及软件设备申请审批截图"}
					];
                }else if (type == '0104'){
                	//sealrecordLayout.getLabelObj('oasealrecord_download_label').hide();
                	//oasealrecordDownload.hide();
                	
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                }else if (type == '0105'){
                	sealrecordLayout.getLabelObj('oasealrecord_finalann_label').setText('<span style="color:red;">*</span>'+"附件: ");
                	sealrecordLayout.getLabelObj('ifneedReturn_label').hide();
                	sealrecordLayout.getLabelObj('returndate_label').hide();
                	ifneedReturn.hide();
                	returndate.hide();
                	//sealrecordLayout.getLabelObj('oasealrecord_download_label').hide();
                	//oasealrecordDownload.hide();
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}
					];
                	
                }else if (type == '0106'){
                	sealrecordLayout.getLabelObj('oasealrecord_finalann_label').setText('<span style="color:red;">*</span>'+"附件: ");
                	sealrecordLayout.getLabelObj('ifneedReturn_label').hide();
                	sealrecordLayout.getLabelObj('returndate_label').hide();
                	ifneedReturn.hide();
                	returndate.hide();
                	//sealrecordLayout.getLabelObj('oasealrecord_download_label').hide();
                	//oasealrecordDownload.hide();
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                	
                }else if(type=='0107'){
                	sealrecordLayout.getLabelObj('oasealrecord_finalann_label').setText('<span style="color:red;">*</span>'+"附件: ");
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                }else if (type == '0108'){
                	sealrecordLayout.getLabelObj('oasealrecord_finalann_label').setText('<span style="color:red;">*</span>'+"附件: ");
                	sealrecordLayout.getLabelObj('oasealrecord_download_label').hide();
                	oasealrecordDownload.hide();
                	/* if(){
                		sealrecordLayout.getLabelObj('returndate_label').hide();
                		returndate.hide();
                    	} */
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                	
                	sealrecordLayout.getLabelObj('oasealrecord_acrosspage_label').hide();
                	oasealrecordAcrossPage.hide();
                	sealrecordLayout.getLabelObj('oasealrecord_sealtype_label').setText('<span style="color:red;">*</span>'+"盖章类型: ");
                	//sealrecordLayout.getLabelObj('oasealrecord_usedate_label').setText('<span style="color:red;">*</span>'+"预计归还日期32: ");
                	
                }else if(type=='0109'){
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                }else if(type=='0110'){
                	sealrecordLayout.getLabelObj('oasealrecord_finalann_label').setText('<span style="color:red;">*</span>'+"附件: ");
                	sealrecordLayout.getLabelObj('ifneedReturn_label').hide();
                	sealrecordLayout.getLabelObj('returndate_label').hide();
                	ifneedReturn.hide();
                	returndate.hide();
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件"}];
                }else if(type=='0111'){
                	veryfyData=[{"gridx":"dataGridFiles","alertMsg":"请上传附件（初稿）"}];
                }
            	var retDataConfig = ctp.data.getJSON("<ctp:url href='proapprove.flowc' flowActionName='query_approveconfig_info'/>" 
                		+ "&id="+type+'&language='+'<ctp:out name ="sessCtx.Language"/>'
  			          +'&userId='+'<ctp:out name="sessCtx.user.id"/>');
    			if(retDataConfig!=null && retDataConfig[0].retCode=='0'){
        			procInstName = retDataConfig[0].procInstName;
        			procInstDesc = retDataConfig[0].procInstDesc;
        			procDefName = retDataConfig[0].procDefName;
        			
        			if(flag == 'add'){
        				if(retDataConfig[0].dataList&&retDataConfig[0].dataList.length>0){
	   		     			 $.each(retDataConfig[0].dataList, function(i, ext){
	   		     				oasealrecordSealType.addGroupItem([{id:'checkbox'+i,label:ext.sealTypeName,value:ext.sealTypeId}]);  
	   		    	         });
	   		         	}
        				var modifyURL = '<ctp:url href="usertestmain.flowc" flowActionName="usersimpledetail"/>'
        					  +'&userId='+'<ctp:out name="sessCtx.user.id"/>'
        					  +'&language='+'<ctp:out name ="sessCtx.Language"/>';
        				ctp.data.getJSONA({
        					    url:modifyURL,
    							success:function(data1){
    								if(data1 && data1[0].retCode == "0"){
    									document.sealrecordForm.flowActionName.value="addsealrecord";
    			                        sealrecordForm.reset();
    			               			//oaapplyrecordbasicAppType.setValue(type);
    			               			//var title1 = oaapplyrecordbasicApply.getValue();
    			               			//var title2 = oaapplyrecordbasicAppDate.getValue();
    			               			//var title  = title1+"于"+title2+"发起的"+title3;
    			               			var dept   = retDataConfig[0].procInstName;
    			               			oaapplyrecordbasicRecTitle.setValue(procInstName);
    			               			oaapplyrecordbasicIsfile.setValue('2');
    			               			//oaapplyrecordbasicStatus.setValue('3');
    			               			applyRemark.setValue(procInstDesc);
    			               			oaapplyrecordbasicOrg.setValue(data1[0].userBranchName);
    			               			oaapplyrecordbasicComp.setValue(data1[0].userworkMajor);
    								}
    							}
    				   });
        				//proToolbarFiles.hide();//新增时
             				
                   }else if(flag =='modify'){
                       document.sealrecordForm.flowActionName.value="editsealrecord";
                       ctp.data.getJSONA({
                           url:'<ctp:url href="sealrecordmain.flowc" flowActionName="querysealrecorddetail"/>',
                           reqData:{
                               "oasealrecordSealId":'<ctp:out name="oasealrecordSealId"/>',
                               "oaapplyrecordbasicRecId":'<ctp:out name="oaapplyrecordbasicRecId"/>',
                               'language':'<ctp:out name ="sessCtx.Language"/>',
            				    'userId':'<ctp:out name="sessCtx.user.id"/>'       
                           },
                           success:function(data){
                               if(data[0].retCode=='0'){
                            	  getDetail(data);
                                  initFile();
                                  setFormDisable(false);
                                  /* if(data[0].oaapplyrecordbasicIsfile!='2'){//非创建中 则不显示提交anniu
                                  	sealrecordForm.getObj("submitButton").hide();
  								  }*/
                                  if(data[0].oaapplyrecordbasicIsfile=='2'){//创建中 都显示
										null;
								  }else if (data[0].oaapplyrecordbasicIsfile=='8'){//退回申请人 提交隐藏
										sealrecordForm.getObj("submitButton").hide();
										ctpToolbar.hideItem("submitButton1","left");
								  }else{
										sealrecordForm.getObj("submitButton").hide();
										ctpToolbar.hideItem("submitButton1","left");
								  }
                                  if(retDataConfig[0].dataList&&retDataConfig[0].dataList.length>0){
         	   		     			 $.each(retDataConfig[0].dataList, function(i, ext){
         	   		     				oasealrecordSealType.addGroupItem([{id:'checkbox'+i,label:ext.sealTypeName,value:ext.sealTypeId}]);  
         	   		    	         });
         	   		         	  }
                                  oasealrecordSealType.setValue(data[0].oasealrecordSealType);
                               }
                           }
                       });
                       applyRemark.setValue(procInstDesc);
                   }else if(flag=='qry'){
                       ctp.data.getJSONA({
                           url:'<ctp:url href="sealrecordmain.flowc" flowActionName="querysealrecorddetail"/>',
                           reqData:{
                               "oasealrecordSealId":'<ctp:out name="oasealrecordSealId"/>',
                               "oaapplyrecordbasicRecId":'<ctp:out name="oaapplyrecordbasicRecId"/>',
                               'language':'<ctp:out name ="sessCtx.Language"/>',
            				    'userId':'<ctp:out name="sessCtx.user.id"/>'       
                           },
                           success:function(data){
                               if(data[0].retCode=='0'){
                            	  getDetail(data);
                                  initFile();
                                  setFormDisable(true);
                                  if(retDataConfig[0].dataList&&retDataConfig[0].dataList.length>0){
	         	   		     			$.each(retDataConfig[0].dataList, function(i, ext){
		         	   		     			if(data[0].oasealrecordSealType.indexOf(ext.sealTypeId)>=0){//只显示勾选的
	         	   		     					oasealrecordSealType.addGroupItem([{id:'checkbox'+i,label:ext.sealTypeName,value:ext.sealTypeId}]);  
		         	   		     			}
	         	   		    	        });
	         	   		          }
                                  oasealrecordSealType.setValue(data[0].oasealrecordSealType);
                               }
                           }
                       });
                       //setFormDisable(true);
                       applyRemark.setValue(procInstDesc);
                       sealrecordForm.getObj("saveButton").hide();
                       sealrecordForm.getObj("submitButton").hide();
                       ctpToolbar.hide();
                       /* if(fileFlag=='1'){//终稿可编辑
                    	   if (type == '0104'||type == '0109'||type == '0111'){//附件 初稿终稿 
	                    	   proToolbarAnn.hide();
	                    	   //proToolbarFiles.hide();
	                       }else if (type == '0105' ||type == '0106'||type == '0107'||type == '0110'||type == '0108'){//附件 终稿 
	                    	   //proToolbarFiles.hide();
	                    	   null;
	                       }else {//三 附件 初稿终稿  图片
	                    	   proToolbarAnn.hide();
	                    	   proToolbarCap.hide();
	                    	   //proToolbarFiles.hide();
	                       }
                       }else{ */
	                       if (type == '0104'||type == '0109'||type == '0111'){//附件 初稿终稿 
	                    	   proToolbarAnn.hide();
	                    	   proToolbarFiles.hide();
	                       }else if (type == '0105' ||type == '0106'||type == '0107'||type == '0110'||type == '0108'){//附件 终稿 
	                    	   proToolbarFiles.hide();
	                       }else {//三 附件 初稿终稿  图片
	                    	   proToolbarAnn.hide();
	                    	   proToolbarCap.hide();
	                    	   proToolbarFiles.hide();
	                       }
                      // }
                   }
    		   }else{
			        ctpMSB.alert({message:'<ctp:label key="pro.approveconig.query.fail"/>'+'id:'+type,title:'<ctp:label key="error_msg"/>',btn:[['确定','OK']],closeBtn:false});
			   }
            }catch(e){
                  ctp.core.log.err(_fnContext, e.message);
            }
        }
        function initFile(){
        	if (type == '0104'||type == '0109'||type == '0111'){//附件 初稿终稿 
            	var data_list_urlAnn1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=0'+'&labelId=oasealrecordAnnexe&businessType='+type;;
			   	dataGridAnn.loadData(data_list_urlAnn1);
			   	var data_list_urlFiles1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;
			   	dataGridFiles.loadData(data_list_urlFiles1);
            }else if (type == '0105' ||type == '0106'||type == '0107'||type == '0110'||type == '0108'){//附件 终稿 
				var data_list_urlFiles1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;
			   	dataGridFiles.loadData(data_list_urlFiles1);
            }else {//三 附件 初稿终稿  图片
            	var data_list_urlAnn1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=0'+'&labelId=oasealrecordAnnexe&businessType='+type;;
			   	dataGridAnn.loadData(data_list_urlAnn1);
			   	var data_list_urlCap1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=1'+'&labelId=oasealrecordCapture&businessType='+type;
				dataGridCap.loadData(data_list_urlCap1);
				var data_list_urlFiles1 = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;
			   	dataGridFiles.loadData(data_list_urlFiles1);
            }
	    }
        
         /*
         * @method getDetail
         * @desc 设置组件值
         * @author lenovo
         */
         function getDetail(data){
             var _fnContext = "sealrecorddetail.jsp -> getDetail();";
             try {
                                 //oaapplyrecordbasicRecId.setValue(data[0].oaapplyrecordbasicRecId);
                                 oaapplyrecordbasicRecTitle.setValue(data[0].oaapplyrecordbasicRecTitle);
                                 //oaapplyrecordbasicAppType.setValue(data[0].oaapplyrecordbasicAppType);
                                 oaapplyrecordbasicApply.setValue(data[0].oaapplyrecordbasicApply);
                                 oaapplyrecordbasicComp.setValue(data[0].oaapplyrecordbasicComp);
                                 oaapplyrecordbasicOrg.setValue(data[0].oaapplyrecordbasicOrg);
                                 oaapplyrecordbasicAppDate.setValue(data[0].oaapplyrecordbasicAppDate);
                                 oaapplyrecordbasicIsfile.setValue(data[0].oaapplyrecordbasicIsfile);
                                 /* oaapplyrecordbasicComment.setValue(data[0].oaapplyrecordbasicComment);
                                 oaapplyrecordbasicTitle.setValue(data[0].oaapplyrecordbasicTitle);
                                 oaapplyrecordbasicCont.setValue(data[0].oaapplyrecordbasicCont);
                                 oaapplyrecordbasicDesign.setValue(data[0].oaapplyrecordbasicDesign); 
                                 oaapplyrecordbasicMethod.setValue(data[0].oaapplyrecordbasicMethod);*/
                                 oaapplyrecordbasicEmergency.setValue(data[0].oaapplyrecordbasicEmergency);
                                 //oaapplyrecordbasicAnnexe.setValue(data[0].oaapplyrecordbasicAnnexe);
                                 //oaapplyrecordbasicStatus.setValue(data[0].oaapplyrecordbasicStatus);
                                 //oaapplyrecordbasicCreateUser.setValue(data[0].oaapplyrecordbasicCreateUser);
                                 //oaapplyrecordbasicCreateDate.setValue(data[0].oaapplyrecordbasicCreateDate);
                                 //oaapplyrecordbasicUpdateUser.setValue(data[0].oaapplyrecordbasicUpdateUser);
                                 //oaapplyrecordbasicUpdateDate.setValue(data[0].oaapplyrecordbasicUpdateDate);
                                 //oaapplyrecordbasicIsdel.setValue(data[0].oaapplyrecordbasicIsdel);
                                 //oaapplyrecordbasicDictId.setValue(data[0].oaapplyrecordbasicDictId);
                                 //oasealrecordSealId.setValue(data[0].oasealrecordSealId);
                                 //oasealrecordRecId.setValue(data[0].oasealrecordRecId);
                                 //oasealrecordSealType.setValue(data[0].oasealrecordSealType);
                                 oasealrecordContent.setValue(data[0].oasealrecordContent);
                                 oasealrecordUsage.setValue(data[0].oasealrecordUsage);
                                 if (type != '0108'){
                                     oasealrecordDownload.setValue(data[0].oasealrecordDownload);
                                     oasealrecordAcrossPage.setValue(data[0].oasealrecordAcrossPage);
                                     if(type != '0107'){
                                        oasealrecordUseDate.setValue(data[0].oasealrecordUseDate);
                      			     }
                                 }else{
                                	 ifneedReturn.setValue(data[0].ifneedReturn);
                                	 returndate.setValue(data[0].returndate);
                                 }
                                 //oasealrecordAnnexe.setValue(data[0].oasealrecordAnnexe);
                                 //oasealrecordCapture.setValue(data[0].oasealrecordCapture);
                                 //oasealrecordFinalAnn.setValue(data[0].oasealrecordFinalAnn);
                                 v_ret_recId = data[0].oaapplyrecordbasicRecId;
                                 
                 }catch(e){
                     ctp.core.log.err(_fnContext, e.message);
                 }
             }
         /*
          * @method setFormDisable
          * @desc  设置表单是否可用
          * @author lenovo
          */
         function setFormDisable(isReadOnly){
             var _fnContext = "sealrecorddetail.jsp -> setFormDisable();";
             try {
                 //sealrecordForm.setDisableAll(flag);
 			    //sealrecordForm.getObj("oaapplyrecordbasicRecId").setReadOnly(true);
 			    sealrecordForm.getObj("oaapplyrecordbasicApply").setReadOnly(true);
 			    sealrecordForm.getObj("oaapplyrecordbasicComp").setReadOnly(true);
 			    sealrecordForm.getObj("oaapplyrecordbasicOrg").setReadOnly(true);
  			    sealrecordForm.getObj("oaapplyrecordbasicAppDate").setReadOnly(true);
 			    sealrecordForm.getObj("oaapplyrecordbasicIsfile").setReadOnly(true);
 			    sealrecordForm.getObj("oaapplyrecordbasicEmergency").setReadOnly(true);

 			    //ealrecordForm.getObj("oaapplyrecordbasicStatus").setReadOnly(true);
 			    //sealrecordForm.getObj("oaapplyrecordbasicDictId").setReadOnly(true);
 			    //sealrecordForm.getObj("oasealrecordSealId").setReadOnly(true);
 			    //sealrecordForm.getObj("oasealrecordRecId").setReadOnly(true);
 			    sealrecordForm.getObj("oasealrecordSealType").setDisable(isReadOnly);
 			    sealrecordForm.getObj("oasealrecordContent").setReadOnly(isReadOnly);
             	sealrecordForm.getObj("oasealrecordUsage").setReadOnly(isReadOnly);
 			    //if (type != '0102'&&type != '0104'&&type != '0105'&&type != '0106'&&type != '0108'){
 			    if (type != '0108'){
     			    sealrecordForm.getObj("oasealrecordDownload").setReadOnly(isReadOnly);
     			    sealrecordForm.getObj("oasealrecordAcrossPage").setReadOnly(isReadOnly);
     			    if(type != '0107'){
     			   		sealrecordForm.getObj("oasealrecordUseDate").setReadOnly(isReadOnly);
     			    }
                 }else{
                 	sealrecordForm.getObj("ifneedReturn").setReadOnly(isReadOnly);
     			    sealrecordForm.getObj("returndate").setReadOnly(isReadOnly);
                 }
 			    //sealrecordForm.getObj("oasealrecordAnnexe").setReadOnly(isReadOnly);
 			    //sealrecordForm.getObj("oasealrecordCapture").setReadOnly(isReadOnly);
 			    //sealrecordForm.getObj("oasealrecordFinalAnn").setReadOnly(isReadOnly);
                 //sealrecordForm.getObj("sealrecordForm").setDisable(false);
                 //sealrecordForm.getObj("returnButton").setDisable(isReadOnly);
                 //sealrecordForm.getObj("saveButton").setDisable(isReadOnly);
                 //sealrecordForm.getObj("submitButton").setDisable(isReadOnly);
                 //sealrecordForm.getObj("addButtonAnn").setDisable(isReadOnly);
                 //sealrecordForm.getObj("delButtonAnn").setDisable(isReadOnly);
                 ///sealrecordForm.getObj("addButtonCap").setDisable(false);
                 //sealrecordForm.getObj("delButtonCap").setDisable(isReadOnly);
                 //sealrecordForm.setDisable("sealrecordForm",false);
             }catch(e){
                  ctp.core.log.err(_fnContext, e.message);
              }
         }
            /*
         * @method sealrecordFormSucc
         * @desc 提交信息
         * @author lenovo
         */
        function sealrecordFormSucc(data){
            var _fnContext = "sealrecorddetail.jsp -> sealrecordFormSucc(data);";
            try {
                var _message ;
                if(flag =='add'){
                	_message = '<ctp:label key="toolbar.new"/>';
                }else if(flag == 'modify'){
                	_message = '<ctp:label key="toolbar.modify"/>';
                }
                if(flagisup =='1'&&data.retCode=="0"){
                	  v_ret_recId=data.recID;
                	  sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
					  flag = 'modify';
					  flagisup="0";
					  return;
				}
				if(submitflag=='submit'&&data.retCode=="0"){
					v_ret_recId=data.recID;
					applyApprove();
					return;
				}
                if(data.retCode=="0"){//提交成功
                    ctpMSB.succeed({
                        title:'<ctp:label key="result_notice"/>',
                        message:_message+'<ctp:label key="success"/>',
                        handler: function(tp){
                        	if(submitflag=='submit'){
								  parent.ctpMSB.close();
	                        	  window.close();
							}else{//保存后 在修改其他信息
								v_ret_recId = data.recID;
								sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
								flag = 'modify';
								flagisup="0";
							}
                        }
                    });
                }else{
                    var msgErr=',<ctp:label key="errorCode"/>:'+data.errorCode+',<ctp:label key="errorMsg"/>:'+data.errorMsg;
                    ctpMSB.error({title:'<ctp:label key="result_notice"/>',message:_message+'<ctp:label key="error"/>'+msgErr});//失败！
                }
             }catch(e){
                ctp.core.log.err(_fnContext, e.message);
            }
         }

        /*
         * @method sealrecordNewFormSubmit
         * @desc  表单提交
         * @author lenovo
         */
        function sealrecordNewFormSave(){
            var _fnContext = "sealrecorddetail.jsp -> sealrecordNewFormSave();";
            submitflag ="save";
            if(validatex()){
            	if(oasealrecordSealType.getCheckedCount()==0){
    				var msgErr='请选择盖章类型!';//请选择参会委员
               	    ctpMSB.alert({message:msgErr});  
    				return;
    		    }
            	if(type == '0108' && ifneedReturn.getValue()==1 && returndate.getValue()== ""){
					var msgError="请填写预计归还日期!";
					ctpMSB.alert({message:msgError});
					return;
    		    }
            	try {
	            	if(flag == 'add'){
	            		sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
	               	 }else if(flag == 'modify'){
	               		sealrecordForm.setHiddenValue("oasealrecordSealId",'<ctp:out name="oasealrecordSealId"/>');
	            		sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
	            		sealrecordForm.setHiddenValue("flowActionName","editsealrecord");
	                 }
	                 sealrecordForm.submit();
	                }catch(e){
	                    ctp.core.log.err(_fnContext, e.message);
	               }
            }
        }
        function fileValidate(){
			var fileVF=true;
			var fileTotalNum=0;
			var gridObj;
			for(var i=0,n=veryfyData.length;i<n;i++){
				gridObj=eval(veryfyData[i].gridx);
				if(gridObj){
					fileTotalNum=gridObj.getTotalNum();
					if(!fileTotalNum || fileTotalNum == 0){
						alert(veryfyData[i].alertMsg);
						fileVF=false;
						break;
					}
				}else{
					continue;
				}
				
			}
			return fileVF;
		}
        
        function sealrecordNewFormSubmit(){
        	//alert(ifneedReturn.getValue()+"------"+returndate.getValue());
            var _fnContext = "sealrecorddetail.jsp -> sealrecordNewFormSubmit();";
            submitflag ="submit";
            if(validatex()&& fileValidate()){
            	if(oasealrecordSealType.getCheckedCount()==0){
    				var msgErr='请选择盖章类型!';
               	    ctpMSB.alert({message:msgErr});  
    				return;
    		    }
    		    
    		     if(type == '0108' && ifneedReturn.getValue()==1 && returndate.getValue()== ""){
						var msgError="请填写预计归还日期!";
						ctpMSB.alert({message:msgError});
						return;
        		    } 
            	try {
	            	if(flag == 'add'){
	            		sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
	               	 }else if(flag == 'modify'){
	               		sealrecordForm.setHiddenValue("oasealrecordSealId",'<ctp:out name="oasealrecordSealId"/>');
	            		sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
	            		sealrecordForm.setHiddenValue("flowActionName","editsealrecord");
	                 }
	                 sealrecordForm.submit();
	                }catch(e){
	                    ctp.core.log.err(_fnContext, e.message);
	               }
            }
        }
        
         /*
         * @method goBack
         * @desc  返回
         * @author lenovo
         */
        function goBack(){
            var _fnContext = "sealrecorddetail.jsp -> goBack();";
            try {
                if( flag == 'new' || flag=='modify'){
                    history.go(-1);
                }else{
                    top.ctpTAB.delTab(top.ctpTAB.getCurrentTabPos());
                }
            }catch(e){
                ctp.core.log.err(_fnContext, e.message);
             }
        }
        /*
         * @method addfile
         * @desc   上传页面
         * @author lenovo
         */
        function addfile(btid){
        	// var srcPath = '<ctp:url href="sealrecordmain.flowc" flowActionName="addfilenew"/>'
        	var v_recId='<ctp:out name="oaapplyrecordbasicRecId"/>';
        	 /* var srcPath = '<ctp:url href="sealrecordmain.flowc" flowActionName="test"/>&recId='+v_recId
				+'&indexId='+'news'+'&lableId='+btid+'&filetype=2'+'&businessType=2'; */

        	 var srcPath = '<ctp:url href="fileuploadmain.flowc" flowActionName="fileuploadlistview"/>&recId='+v_recId
				+'&indexId='+'news'+'&lableId='+btid+'&filetype=2'+'&businessType=2'; 
			      ctpMSB.win({
			      message   :srcPath,
			      width     :700,
			      height    :400,
			      title     :'文件上传页面',
			      maxBtn    :true,
			      minBtn    :true,
			      iframe    :true,
			      handler   :handler_upload
			      });    
        }
        /*
         * @method 
         * @desc   
         * @author lenovo
         */
        function handler_upload(retObj){
            var fileName=retObj.fileName;
            var fileId=retObj.fileId;
            var lableId=retObj.lableId;
            if("oaapplyrecordbasicAnnexe"==(lableId)){
            	oaapplyrecordbasicAnnexe.setValue(fileId);
                }
            if("oasealrecordAnnexe"==(lableId)){
            	oasealrecordAnnexe.setValue(fileId);
                }
            if("oasealrecordCapture"==(lableId)){
            	oasealrecordCapture.setValue(fileId);
                }
            if("oasealrecordFinalAnn"==(lableId)){
            	oasealrecordFinalAnn.setValue(fileId);
                }
            
        	
        }
        function validatex(){
			for(var i=0,n=validateArray.length;i<n;i++){
				if(!validateArray[i]){
					continue;
				}
				if(!(formValidator.validateObjs(validateArray[i]))){
					try{
						validateArray[i].focus();
					}catch(err){
						jQuery("#_ctp_panel_content_queryPanel")[0].scrollTop=0;
						jQuery("#"+validateArray[i].getDomId()).focus();
					}
					return formValidator.validateObjs(validateArray[i]);
				}
			}
			return true;
		}
        
        function applyApprove(){  //发起审批流
        	ctp.data.getJSONA({
        				url:'<ctp:url href="proapprove.flowc" flowActionName="start_busi_process_op"/>',  //创建流程
        				reqData:{"procDefName":procDefName,"procInstName":procInstName,"procInstDesc":"","transactionSpan":"true"},   
        				success:function(data){ 
        					if(data[0].processInstId != "-1"){
        						/* if(provType=='0204'){//一般固定资产采购申请流程 
        							var urlaa ="<ctp:url href='proapprove.flowc' flowActionName='set_relative_data'/>" //设置相关数据 机构 ID（branchId）
		        		        		+ "&procInstId="+data[0].processInstId +"&xpath="+"assetsType"+"&relaData="+assetsType.getValue();
		        		        	var retDataAA = ctp.data.getJSON(urlaa);
        	 					} */
        						var retData = ctp.data.getJSON("<ctp:url href='proapprove.flowc' flowActionName='save_approve_start_op'/>"  
				                		+ "&id="+v_ret_recId+"&processInstId="+data[0].processInstId+"&procDefName="+procDefName);
			                	if(retData[0].retCode && retData[0].retCode=='0'){
		        						ctp.data.getJSONA({
		        	        				url:'<ctp:url href="proapprove.flowc" flowActionName="start_first_work_op"/>',  //启动流程
		        	        				reqData:{"processInstId":data[0].processInstId},
		        	        				success:function(datanew){
		    				                	ctpMSB.succeed({title:'<ctp:label key="operation_result_title"/>',message:'<ctp:label key="pro.apply.success"/>',handler: handler_operation});//产品申请提交成功
		        	        				},
		        	        				error:function(){
		        	        					ctpMSB.error({title:'<ctp:label key="operation_result_title"/>',message:'提交失败，请联系管理员！'});
		        	        				}
		        						});
			                	}else{
			                		ctpMSB.error({title:'<ctp:label key="operation_result_title"/>',message:'提交失败，请联系管理员！！'});
			        			}
        				    }else{
        				    	ctpMSB.error({title:'<ctp:label key="operation_result_title"/>',message:'提交失败，请联系管理员！！！'});
        					}
        				}
        	});	 
		}
		function handler_operation(){
			parent.ctpMSB.close();
       	    window.opener.location.reload(); 
    	    window.close();
    	    //parent.ctpMSB.doHandler("ok",true);
	    }
	    
        </script>
        
        <script type='text/javascript' kind='ui'>

        $(window).load(function(){

			
			
        	
               /* oaapplyrecordbasicRecId = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicRecId',
                    width:'80%',
                    validate: 'rules[required]'
                }); */

                applyRemark = new ctp.ui.textarea ({//流程描述
					id : 'applyRemark' ,
					rmLineBreak :false,
					readOnly :true,
					rows:3,
					width:'91%'
				});


                oaapplyrecordbasicRecTitle = new ctp.ui.textfield ({//流程标题
                    id: 'oaapplyrecordbasicRecTitle',
                    readOnly :true,
                    width:'91%'
                });

  
                /* oaapplyrecordbasicAppType = new ctp.ui.combobox ({
                    id: 'oaapplyrecordbasicAppType',
                    width:'80%',
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="OASEALAPPTYPE" dictname="A"/>              }); */

                           
                oaapplyrecordbasicApply = new ctp.ui.textfield ({//申请人:
                    id: 'oaapplyrecordbasicApply',
                    readOnly :true,
                    width:'80%',
                    value:'<ctp:out name="sessCtx.user.name"/>'              
                });
                    
                oaapplyrecordbasicIsfile = new ctp.ui.combobox ({//归档状态:
                        id: 'oaapplyrecordbasicIsfile',
                        width:'80%',
                        readOnly :true,
                        defaultItems:[{
        			     	text:'--请选择--',
        			     	value:'',
        			     	selected:'true'
        			     }],
                        items:<ctp:dictdata dicttype="OAISFILE" dictname="A"/> 
               });

               oaapplyrecordbasicOrg = new ctp.ui.textfield ({//申请部门:
                    id: 'oaapplyrecordbasicOrg',
                    readOnly :true,
                    width:'80%'
               });
				
               oaapplyrecordbasicStatus = new ctp.ui.combobox ({//审批状态
                    id: 'oaapplyrecordbasicStatus',
                    width:'80%',
                    readOnly :true,
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="OAUSERAPPROVE" dictname="A"/> 
              });

              oaapplyrecordbasicComp = new ctp.ui.combobox ({//所在公司
                    id: 'oaapplyrecordbasicComp',
                    width:'80%',
                    readOnly :true,
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="OACONTRACTMAJOR" dictname="A"/>}
              );
                
             oaapplyrecordbasicAppDate = new ctp.ui.datepicker ({//申请时间:
                    id : 'oaapplyrecordbasicAppDate',
                    isInput:true,
                    readOnly :true,
                    width:'80%',
                    showTime:true
             });

                
                /* oaapplyrecordbasicComment = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicComment',
                    width:'80%'
                });


                oaapplyrecordbasicTitle = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicTitle',
                    width:'80%'
                });


                oaapplyrecordbasicCont = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicCont',
                    width:'80%'
                });


                oaapplyrecordbasicDesign = new ctp.ui.combobox ({
                    id: 'oaapplyrecordbasicDesign',
                    width:'80%',
                    defaultItems:[{text:'aaa',value:'1',selected:'true'}]                });


                oaapplyrecordbasicMethod = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicMethod',
                    width:'80%'
                }); */


                oaapplyrecordbasicEmergency = new ctp.ui.combobox ({//紧急情况:
                    id: 'oaapplyrecordbasicEmergency',
                    validate:'rules[required]',
                    width:'80%',
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="OAEMERGENCY" dictname="A"/>                  
                });
                validateArray.push(oaapplyrecordbasicEmergency);
                
                oasealrecordUseDate = new ctp.ui.datepicker ({//用印日期:
                    id: 'oasealrecordUseDate',
                    validate:'rules[required]',
                    width:'80%',
                    value:''
                   // showTime:true
                });
                if (type != '0108' && type != '0107'){
                    validateArray.push(oasealrecordUseDate);
                }


                oasealrecordUsage = new ctp.ui.textfield ({//*文件份数:
                    id: 'oasealrecordUsage',
                    validate:'rules[required,custom[testCustomRex1]]',
                    width:'80%'
                });
                validateArray.push(oasealrecordUsage);

                oasealrecordSealType= new ctp.ui.checkboxgroup ({//印章类型
                    id: 'oasealrecordSealType',
                    width:'80%',
                    //validate: 'rules[required]',
                    display :'cols'		//rows     
                });
                //validateArray.push(oasealrecordSealType);
               
                oasealrecordContent = new ctp.ui.textarea ({//用印事由:
					id : 'oasealrecordContent' ,
					validate:'rules[required]',
					rmLineBreak :false,
					rows:3,
					width:'91%'
				});
                validateArray.push(oasealrecordContent);
              
                oasealrecordDownload = new ctp.ui.combobox ({//是否需公章管理员下载:
                    id: 'oasealrecordDownload',
                    validate:'rules[required]',
                    width:'80%',
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="REQUIRED" dictname="A"/>
                });
                
                //if (type != '0102'&&type != '0104'&&type != '0105'&&type != '0106'&&type != '0108'){
                if (type != '0108'){
                    validateArray.push(oasealrecordDownload);
                }
                oasealrecordAcrossPage = new ctp.ui.combobox ({//*是否加盖骑缝章
                    id: 'oasealrecordAcrossPage',
                    validate:'rules[required]',
                    width:'80%',
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
                    items:<ctp:dictdata dicttype="REQUIRED" dictname="A"/>
                });
                if (type != '0108'){
                    validateArray.push(oasealrecordAcrossPage);
                }
                ifneedReturn = new ctp.ui.combobox ({//是否需要归还
                    id: 'ifneedReturn',
                    validate:'rules[required]',
                    width:'80%',
                    defaultItems:[{
    			     	text:'--请选择--',
    			     	value:'',
    			     	selected:'true'
    			     }],
    			     items:<ctp:dictdata dicttype="REQUIRED" dictname="A"/>,
            		onChange:function(oldValue,newValue){
							if(newValue == 1){
						            sealrecordForm.getObj("returndate").setReadOnly(false);
							}else{
									sealrecordForm.getObj("returndate").setReadOnly(true);
									sealrecordForm.getObj("returndate").setValue("");
							}
                		}
        		
                });
                if (type == '0108'){
                    validateArray.push(ifneedReturn);
                }
                returndate = new ctp.ui.datepicker ({//预计归还日期
                    id: 'returndate',
                    //validate:'rules[required]',
                    width:'80%',
                    value:''
                });
                //validateArray.push(returndate);
                /* oaapplyrecordbasicAnnexe = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicAnnexe',
                    width: '80%',	
             	    type:'button',
             	    buttonSet:{text:'浏览...',width:'50px',onClick:function(caller){addfile(caller.getId());}}
                });
 */
                oaapplyrecordbasicCreateUser = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicCreateUser',
                    width:'80%'
                });


                oaapplyrecordbasicCreateDate = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicCreateDate',
                    width:'80%'
                });


                oaapplyrecordbasicUpdateUser = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicUpdateUser',
                    width:'80%'
                });


                oaapplyrecordbasicUpdateDate = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicUpdateDate',
                    width:'80%'
                });


                oaapplyrecordbasicIsdel = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicIsdel',
                    width:'80%'
                });


                oaapplyrecordbasicDictId = new ctp.ui.textfield ({
                    id: 'oaapplyrecordbasicDictId',
                    width:'80%'
                });
 

                oasealrecordSealId = new ctp.ui.textfield ({
                    id: 'oasealrecordSealId',
                    width:'80%',
                    validate: 'rules[required]'
                });

                content = new ctp.ui.textarea ({//附件说明
					id : 'content' ,
					//beanName:'oacoperatio',
					rmLineBreak :false,
					readOnly :true,
					rows:'3',
					readOnly :true,
					width:'90%',
					value:'包括但不限于：个人：客户身份证复印件正反面、银行卡正反面、原合同（签字盖章版，以PDF格式上传）、金融机构要求的全套变更合同（以PDF格式上传）、大唐财富要求的全套变更文件（以PDF格式上传）、客户与银行卡的拍照、银行证明。机构：营业执照复印件、组织机构代码证复印件、公司章程、法人代表身份证复印件、金融机构要求的全套变更合同（以PDF格式上传）、大唐财富要求的全套变更文件（以PDF格式上传）。'
				});
				


               /*  oasealrecordRecId = new ctp.ui.textfield ({
                    id: 'oasealrecordRecId',
                    width:'80%'
                }); */
        

                oasealrecordAnnexe = new ctp.ui.textfield({
                    id: 'oasealrecordAnnexe',
                       width: '80%',	
                	   type:'button',
                	   buttonSet:{text:'浏览...',width:'50px',onClick:function(caller){addfile(caller.getId());}}
                });
                				


				
                oasealrecordCapture = new ctp.ui.textfield ({
                    id: 'oasealrecordCapture',
                    width: '80%',	
             	   type:'button',
             	   buttonSet:{text:'浏览...',width:'50px',onClick:function(caller){addfile(caller.getId());}}
                });


                oasealrecordFinalAnn = new ctp.ui.textfield ({
                    id: 'oasealrecordFinalAnn',
                    width: '80%',	
             	    type:'button',
             	    buttonSet:{text:'浏览...',width:'50px',onClick:function(caller){addfile(caller.getId());}}
                });


                //以下附件部分代码
 
 		       
 			 //----附件初稿开始
                headerAnn=new ctp.ui.grid.header({//附件列头
					title: [
						[{text: ""},
						{text: '文件链接',width:'300px'},//文件链接
						{text: '上传时间'},//上传时间
						{text: '上传人',css:{"text-align":"center"}},//上传人
				 		]
					],
				  	rowIdFieldName: "id",
				  	attr: [
							{colType: "radiobox"},
								{fieldName: "fileName",
									fieldType: 'link',//生成下载超链接，添加下载方法
				                    fieldAttr:{title:'<ctp:label key="下载附件"/>',onClick: downloadFiles}},//'下载附件'
				                    {fieldName: "postDate"},
				                    {fieldName: "postUser",css:{"text-align":"center"}}
						]
				});
			   	proToolbarAnn = new ctp.ui.toolbar({//附件按钮
			       	id: 'proToolbarAnn',
			       	leftItems: [
			          	 {
			          	     type: 'button',
			          	     id: 'addButtonAnn',
			         	     text: '新增',//新增
			          	     icon: 'add',
			          	     onClick: function(){
			     				var relId ='';
			     				if(flag=='add'){ //新增页面
			     					flagisup = "1" ;
			     					if(!validatex()){
			     						 var msgErr='<ctp:label key="save.fail"/>';              
			     	                     ctpMSB.error({
			     	                        title:'<ctp:label key="error"/>',
			     	                        message:msgErr
			     	                     });//操作失败！
			     	                     return;
			     					}
			     					if(oasealrecordSealType.getCheckedCount()==0){
			     	       				var msgErr='请选择盖章类型!';//请选择参会委员
			     	                  	    ctpMSB.alert({message:msgErr});  
			     	       				return;
			     	       			}
 			     					sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
 			     					sealrecordForm.submit();
 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=0'+'&labelId=oasealrecordAnnexe&businessType='+type;//businessType 2 用户管理模块
 			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridAnn
			     			        });
			     				}else if(flag=="modify") {//修改
			     					relId='<ctp:out name="id"/>';
 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=0'+'&labelId=oasealrecordAnnexe&businessType='+type;//businessType 01 用鉴记录管理模块
			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridAnn
			     			           });
			     			    } 
			             }
			           },'-',{
			               type: 'button',
			               id: 'delButtonAnn',
			               text: '删除',//'删除',
			               icon: 'delete',
			               onClick: function(){
			            	   if(dataGridAnn.getSelectedRowId().length==0){
			                  		ctpMSB.alert({message:'请先选择需要删除的数据'});//'请先选择需要删除的数据
			                  		return;
			              		}
			              		ctpMSB.confirm({
			          				message:'确定要删除么？',//'确定要删除么？',
			          				handler:function(tp){
			          					if(tp=="ok"){
			          						var _id=dataGridAnn.getSelectedRowId()[0];
			          						var _data=dataGridAnn.getSelectedData()[0];
			          						var fileUrl = _data.realpath;
			          						ctp.data.getJSONA({
			          							url:'<ctp:url href="fileuploadnew.flowc" />',
			          							reqData:{
			          								"flowActionName":"deleteindexfile",
			          								"id":_id,
			          								"userId":'<ctp:out name="sessCtx.user.id"/>',
			          								"fileUrl":fileUrl
			          							},
			          							success:function(data){
			          								if(data && data[0].retCode=="0"){
			          									ctpMSB.alert({message:'删除成功'});//'删除成功'
			          									//dataGridAnn.loadData(data_list_urlAnn);
			          									handler_loadGridAnn();
			          								}else{
			          									ctpMSB.alert({message:'删除失败'});//'删除失败'
			          								}
			          							}
			          						});
			          					}
			          					if(tp=="cancle"){
			          						return;
			          					}
			              			}
			              		});
			               }
			           }
			       ]
			   });
			   dataGridAnn = new ctp.ui.grid({//附件数据
		      		id: "dataGridAnn",
		      		height: '250px',
		      		width:'90%',
		      		title: '附件初稿',
		      		header: headerAnn,
		      		//url: data_list_urlFiles,
		            toolbar: proToolbarAnn,
		            toolbarPos: 'innertop',
		            footer: {
						auto:true                    
                	}
		       });

			   function handler_loadGridAnn(){//上传 删除后更新附件列表
					data_list_urlAnn = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=0'+'&labelId=oasealrecordAnnexe&businessType='+type;;
				   	dataGridAnn.loadData(data_list_urlAnn);
			   	}
			   	function downloadAnn(){//文件下载功能
					downloadForm.openType.value = "attachment";
					downloadForm.fileName.value = this.filePath;
					downloadForm.showFileName.value = this.fileName;
					downloadForm.submit();
			    }
		       //---附件结束
		       
		       
			    //----审批截图开始
                headerCap=new ctp.ui.grid.header({//附件列头
					title: [
						[{text: ""},
						{text: '文件链接',width:'300px'},//文件链接
						{text: '上传时间'},//上传时间
						{text: '上传人',css:{"text-align":"center"}},//上传人
				 		]
					],
				  	rowIdFieldName: "id",
				  	attr: [
							{colType: "radiobox"},
								{fieldName: "fileName",
									fieldType: 'link',//生成下载超链接，添加下载方法
				                    fieldAttr:{title:'<ctp:label key="下载附件"/>',onClick: downloadCap}},//'下载附件'
				                    {fieldName: "postDate"},
				                    {fieldName: "postUser",css:{"text-align":"center"}}
						]
				});
			   	proToolbarCap = new ctp.ui.toolbar({//附件按钮
			       	id: 'proToolbarCap',
			       	leftItems: [
			          	 {
			          	     type: 'button',
			          	     id: 'addButtonCap',
			         	     text: '新增',//新增
			          	     icon: 'add',
			          	     onClick: function(){
			     				var relId ='';
			     				if(flag=='add'){ //新增页面
			     					flagisup = "1" ;
			     					if(!validatex()){
			     						 var msgErr='<ctp:label key="save.fail"/>';              
			     	                     ctpMSB.error({
			     	                        title:'<ctp:label key="error"/>',
			     	                        message:msgErr
			     	                     });//操作失败！
			     	                     return;
			     					}
			     					if(oasealrecordSealType.getCheckedCount()==0){
			     	       				var msgErr='请选择盖章类型!';//请选择参会委员
			     	                  	    ctpMSB.alert({message:msgErr});  
			     	       				return;
			     	       			 }
			     					sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
 			     					sealrecordForm.submit();
 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=1'+'&labelId=oasealrecordCapture&businessType='+type;//businessType 2 用户管理模块
 			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridCap
			     			        });
			     				}else if(flag=="modify") {//修改
			     					relId='<ctp:out name="id"/>';
 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=1'+'&labelId=oasealrecordCapture&businessType='+type;//businessType 2 用户管理模块
			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridCap
			     			           });
			     			    } 
			             }
			           },'-',{
			               type: 'button',
			               id: 'delButtonCap',
			               text: '删除',//'删除',
			               icon: 'delete',
			               onClick: function(){
			            	   if(dataGridCap.getSelectedRowId().length==0){
			                  		ctpMSB.alert({message:'请先选择需要删除的数据'});//'请先选择需要删除的数据
			                  		return;
			              		}
			              		ctpMSB.confirm({
			          				message:'确定要删除么？',//'确定要删除么？',
			          				handler:function(tp){
			          					if(tp=="ok"){
			          						var _id=dataGridCap.getSelectedRowId()[0];
			          						var _data=dataGridCap.getSelectedData()[0];
			          						var fileUrl = _data.realpath;
			          						ctp.data.getJSONA({
			          							url:'<ctp:url href="fileuploadnew.flowc" />',
			          							reqData:{
			          								"flowActionName":"deleteindexfile",
			          								"id":_id,
			          								"userId":'<ctp:out name="sessCtx.user.id"/>',
			          								"fileUrl":fileUrl
			          							},
			          							success:function(data){
			          								if(data && data[0].retCode=="0"){
			          									ctpMSB.alert({message:'删除成功'});//'删除成功'
			          									handler_loadGridCap();
			          									//dataGridCap.loadData(data_list_urlCap);
			          								}else{
			          									ctpMSB.alert({message:'删除失败'});//'删除失败'
			          								}
			          							}
			          						});
			          					}
			          					if(tp=="cancle"){
			          						return;
			          					}
			              			}
			              		});
			               }
			           }
			       ]
			   });
			   dataGridCap = new ctp.ui.grid({//附件数据
		      		id: "dataGridCap",
		      		height: '250px',
		      		width:'90%',
		      		title: '附件截图',
		      		header: headerCap,
		      		//url: data_list_urlFiles,
		            toolbar: proToolbarCap,
		            toolbarPos: 'innertop',
		            footer: {
						auto:true                    
                	}
		       });

			   function handler_loadGridCap(){//上传 删除后更新附件列表
					data_list_urlCap = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=1'+'&labelId=oasealrecordCapture&businessType='+type;
					dataGridCap.loadData(data_list_urlCap);
			   	}
			   	function downloadCap(){//文件下载功能
					downloadForm.openType.value = "attachment";
					downloadForm.fileName.value = this.filePath;
					downloadForm.showFileName.value = this.fileName;
					downloadForm.submit();
			    }
		       //---初稿附件结束
		       
		       
			  //----附件终稿开始
                headerFiles=new ctp.ui.grid.header({//附件列头
					title: [
						[{text: ""},
						{text: '文件链接',width:'300px'},//文件链接
						{text: '上传时间'},//上传时间
						{text: '上传人',css:{"text-align":"center"}},//上传人
				 		]
					],
				  	rowIdFieldName: "id",
				  	attr: [
							{colType: "radiobox"},
								{fieldName: "fileName",
									fieldType: 'link',//生成下载超链接，添加下载方法
				                    fieldAttr:{title:'<ctp:label key="下载附件"/>',onClick: downloadFiles}},//'下载附件'
				                    {fieldName: "postDate"},
				                    {fieldName: "postUser",css:{"text-align":"center"}}
						]
				});
			   	proToolbarFiles = new ctp.ui.toolbar({//附件按钮
			       	id: 'proToolbarFiles',
			       	leftItems: [
			          	 {
			          	     type: 'button',
			          	     id: 'addButtonFiles',
			         	     text: '新增',//新增
			          	     icon: 'add',
			          	     onClick: function(){
			     				var relId ='';
			     				if(flag=='add'){ //新增页面
			     					flagisup = "1" ;
			     					sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
			     					sealrecordForm.submit();
			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;//businessType 2 用户管理模块
			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridFiles
			     			        });
			     				}else if(flag=="modify") {//修改
			     					relId='<ctp:out name="id"/>';
			     					var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;//businessType 2 用户管理模块
			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridFiles
			     			           });
			     			    }else if(fileFlag == '1'){//1:详细页面打开最终附件 可上传 删除
			     					var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;//businessType 2 用户管理模块
			     		           	   ctpMSB.win({
			     				           message   :srcPath,
			     				           width     :600,
			     				           height    :450,
			     				           title     :'附件上传页面',//附件上传页面
			     				           maxBtn    :true,
			     				           minBtn    :true,
			     				           iframe    :true,
			     				           handler   :handler_loadGridFiles
			     			           });
				     			} 
			             }
			           },'-',{
			               type: 'button',
			               id: 'delButtonFiles',
			               text: '删除',//'删除',
			               icon: 'delete',
			               onClick: function(){
			            	   if(dataGridFiles.getSelectedRowId().length==0){
			                  		ctpMSB.alert({message:'请先选择需要删除的数据'});//'请先选择需要删除的数据
			                  		return;
			              		}
			              		ctpMSB.confirm({
			          				message:'确定要删除么？',//'确定要删除么？',
			          				handler:function(tp){
			          					if(tp=="ok"){
			          						var _id=dataGridFiles.getSelectedRowId()[0];
			          						var _data=dataGridFiles.getSelectedData()[0];
			          						var fileUrl = _data.realpath;
			          						ctp.data.getJSONA({
			          							url:'<ctp:url href="fileuploadnew.flowc" />',
			          							reqData:{
			          								"flowActionName":"deleteindexfile",
			          								"id":_id,
			          								"userId":'<ctp:out name="sessCtx.user.id"/>',
			          								"fileUrl":fileUrl
			          							},
			          							success:function(data){
			          								if(data && data[0].retCode=="0"){
			          									ctpMSB.alert({message:'删除成功'});//'删除成功'
			          									handler_loadGridFiles();
			          									//dataGridFiles.loadData(data_list_urlFiles);
			          								}else{
			          									ctpMSB.alert({message:'删除失败'});//'删除失败'
			          								}
			          							}
			          						});
			          					}
			          					if(tp=="cancle"){
			          						return;
			          					}
			              			}
			              		});
			               }
			           }
			       ]
			   });
			   dataGridFiles = new ctp.ui.grid({//附件数据
		      		id: "dataGridFiles",
		      		height: '250px',
		      		width:'90%',
		      		title: '附件',
		      		header: headerFiles,
		      		//url: data_list_urlFiles,
		            toolbar: proToolbarFiles,
		            toolbarPos: 'innertop',
		            footer: {
						auto:true                    
                	}
		       });

			   function handler_loadGridFiles(){//上传 删除后更新附件列表
					data_list_urlFiles = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ret_recId+'&indexId=2'+'&labelId=oasealrecordFinalAnn&businessType='+type;
				   	dataGridFiles.loadData(data_list_urlFiles);
			   	}
			   	function downloadFiles(){//文件下载功能
					downloadForm.openType.value = "attachment";
					downloadForm.fileName.value = this.filePath;
					downloadForm.showFileName.value = this.fileName;
					downloadForm.submit();
			    }
		       //---终稿附件结束
               
                var itemval ;
			   	if (type == '0104'||type == '0109'||type == '0111'){//附件 
                	itemval = [[
					 {label: {id:'applyRemark_label',text: '<ctp:label key="applyRemark"/>:'},element: applyRemark,colspan:3}
						] ,
                       [
                           {label: {id:'oaapplyrecordbasic_rectitle_label',text: '<ctp:label key="oaapplyrecordbasicRecTitle"/>:'},element: oaapplyrecordbasicRecTitle,colspan:3}
                       ] ,
                       [
                           {label: {id:'oaapplyrecordbasic_apply_label',text: '<ctp:label key="oaapplyrecordbasicApply"/>:'},element: oaapplyrecordbasicApply},    
                           {label: {id:'oaapplyrecordbasic_isfile_label',text: '<ctp:label key="oaapplyrecordbasicIsfile"/>:'},element: oaapplyrecordbasicIsfile}
                       ] ,
                       [
                           {label: {id:'oaapplyrecordbasic_org_label',text: '<ctp:label key="oaapplyrecordbasicOrg"/>:'},element: oaapplyrecordbasicOrg},
                           {label: {id:'oaapplyrecordbasic_appdate_label',text: '<ctp:label key="oaapplyrecordbasicAppDate"/>:'},element: oaapplyrecordbasicAppDate}
                           //{label: {id:'oaapplyrecordbasic_status_label',text: '<ctp:label key="oaapplyrecordbasicStatus"/>:'},element: oaapplyrecordbasicStatus}
                       ],
                       [
                           {label: {id:'oaapplyrecordbasic_comp_label',text: '<ctp:label key="oaapplyrecordbasicComp"/>:'},element: oaapplyrecordbasicComp}
                       ],
                       [
                           {label: {id:'oaapplyrecordbasic_emergency_label',text: '<span style="color:red;">*</span><ctp:label key="oaapplyrecordbasicEmergency"/>:'},element: oaapplyrecordbasicEmergency},
                           {label: {id:'oasealrecord_usedate_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUseDate"/>:'},element: oasealrecordUseDate},
                       ],
                       [
                           {label: {id:'oasealrecord_usage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUsage"/>:'},element: oasealrecordUsage}
                       ],
                       [
						 {label: {id:'oasealrecord_sealtype_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordSealType"/>:'},element: oasealrecordSealType}
                       ],
                       [
	                        
	                        {label: {id:'oasealrecord_content_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordContent"/>:'},element: oasealrecordContent,colspan:3}
	                    ],
                       [
                           {label: {id:'oasealrecord_acrosspage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAcrossPage"/>:'},element: oasealrecordAcrossPage},
                           {label: {id:'oasealrecord_download_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordDownload"/>:'},element: oasealrecordDownload}
                       ], 
                       
                       [
                           {label: {id:'oasealrecord_annexe_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAnnexe"/>:'}, element: dataGridAnn,colspan:3}
                           
                       ],
                        /* [
                           {label: {id:'oasealrecord_capture_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordCapture"/>:'},element: dataGridCap,colspan:3}
                       ], */
                       [
	                        {label: {id:'oasealrecord_finalann_label',text: '<ctp:label key="oasealrecordFinalAnn"/>:'},element: dataGridFiles,colspan:3}
	                    ]];
                }else if (type == '0105' ||type == '0106'||type == '0110'){//
                	itemval = [[
           					 {label: {id:'applyRemark_label',text: '<ctp:label key="applyRemark"/>:'},element: applyRemark,colspan:3}
           						] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_rectitle_label',text: '<ctp:label key="oaapplyrecordbasicRecTitle"/>:'},element: oaapplyrecordbasicRecTitle,colspan:3}
                                  ] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_apply_label',text: '<ctp:label key="oaapplyrecordbasicApply"/>:'},element: oaapplyrecordbasicApply},    
                                      {label: {id:'oaapplyrecordbasic_isfile_label',text: '<ctp:label key="oaapplyrecordbasicIsfile"/>:'},element: oaapplyrecordbasicIsfile}
                                  ] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_org_label',text: '<ctp:label key="oaapplyrecordbasicOrg"/>:'},element: oaapplyrecordbasicOrg},
                                      {label: {id:'oaapplyrecordbasic_appdate_label',text: '<ctp:label key="oaapplyrecordbasicAppDate"/>:'},element: oaapplyrecordbasicAppDate}
                                      //{label: {id:'oaapplyrecordbasic_status_label',text: '<ctp:label key="oaapplyrecordbasicStatus"/>:'},element: oaapplyrecordbasicStatus}
                                  ],
                                  [
                                      {label: {id:'oaapplyrecordbasic_comp_label',text: '<ctp:label key="oaapplyrecordbasicComp"/>:'},element: oaapplyrecordbasicComp}
                                  ],
                                  [
                                      {label: {id:'oaapplyrecordbasic_emergency_label',text: '<span style="color:red;">*</span><ctp:label key="oaapplyrecordbasicEmergency"/>:'},element: oaapplyrecordbasicEmergency},
                                      {label: {id:'oasealrecord_usedate_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUseDate"/>:'},element: oasealrecordUseDate}
                                  ],
                                  [
                                      
                                      {label: {id:'oasealrecord_usage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUsage"/>:'},element: oasealrecordUsage}
                                      
                                  ],
                                  [
									 {label: {id:'oasealrecord_sealtype_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordSealType"/>:'},element: oasealrecordSealType}
                                   ],
	           	                 [
			                        {label: {id:'ifneedReturn_label',text: '<span style="color:red;">*</span>是否需要归还:'},element: ifneedReturn},
			                        {label: {id:'returndate_label',text: '<span style="color:red;">*</span>预计归还日期:'},element: returndate}
			                     ],
                                  [
                                      {label: {id:'oasealrecord_content_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordContent"/>:'},element: oasealrecordContent,colspan:3}
                                  ],
                                  [
                                      {label: {id:'oasealrecord_acrosspage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAcrossPage"/>:'},element: oasealrecordAcrossPage},
                                      {label: {id:'oasealrecord_download_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordDownload"/>:'},element: oasealrecordDownload}
                                  ], 
                                  
                                  /* [
                                      {label: {id:'oasealrecord_annexe_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAnnexe"/>:'}, element: dataGridAnn,colspan:3}
                                  ], */
                                   /* [
                                      {label: {id:'oasealrecord_capture_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordCapture"/>:'},element: dataGridCap,colspan:3}
                                  ], */
                                  [
                                      {label: {id:'oasealrecord_finalann_label',text: '<ctp:label key="oasealrecordFinalAnn"/>:'},element: dataGridFiles,colspan:3}
                                  ]];
                }else if (type == '0108'){//
                	itemval = [[
              					 {label: {id:'applyRemark_label',text: '<ctp:label key="applyRemark"/>:'},element: applyRemark,colspan:3}
              						] ,
                                     [
                                         {label: {id:'oaapplyrecordbasic_rectitle_label',text: '<ctp:label key="oaapplyrecordbasicRecTitle"/>:'},element: oaapplyrecordbasicRecTitle,colspan:3}
                                     ] ,
                                     [
                                         {label: {id:'oaapplyrecordbasic_apply_label',text: '<ctp:label key="oaapplyrecordbasicApply"/>:'},element: oaapplyrecordbasicApply},    
                                         {label: {id:'oaapplyrecordbasic_isfile_label',text: '<ctp:label key="oaapplyrecordbasicIsfile"/>:'},element: oaapplyrecordbasicIsfile}
                                     ] ,
                                     [
                                         {label: {id:'oaapplyrecordbasic_org_label',text: '<ctp:label key="oaapplyrecordbasicOrg"/>:'},element: oaapplyrecordbasicOrg},
                                         {label: {id:'oaapplyrecordbasic_appdate_label',text: '<ctp:label key="oaapplyrecordbasicAppDate"/>:'},element: oaapplyrecordbasicAppDate}
                                         //{label: {id:'oaapplyrecordbasic_status_label',text: '<ctp:label key="oaapplyrecordbasicStatus"/>:'},element: oaapplyrecordbasicStatus}
                                     ],
                                     [
                                         {label: {id:'oaapplyrecordbasic_comp_label',text: '<ctp:label key="oaapplyrecordbasicComp"/>:'},element: oaapplyrecordbasicComp}
                                     ],
                                     [
                                         {label: {id:'oaapplyrecordbasic_emergency_label',text: '<span style="color:red;">*</span><ctp:label key="oaapplyrecordbasicEmergency"/>:'},element: oaapplyrecordbasicEmergency},
                                         {label: {id:'oasealrecord_usage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUsage"/>:'},element: oasealrecordUsage},
                                         
                                     ],
                                     [
   									 {label: {id:'oasealrecord_sealtype_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordSealType"/>:'},element: oasealrecordSealType}
                                      ],
   	           	                 [
   			                        {label: {id:'ifneedReturn_label',text: '<span style="color:red;">*</span>是否需要归还:'},element: ifneedReturn},
   			                        {label: {id:'returndate_label',text: '<span style="color:red;">*</span>预计归还日期:'},element: returndate}
   			                     ],
                                     [
                                         {label: {id:'oasealrecord_content_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordContent"/>:'},element: oasealrecordContent,colspan:3}
                                     ],
                                     [
                                         {label: {id:'oasealrecord_acrosspage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAcrossPage"/>:'},element: oasealrecordAcrossPage},
                                         {label: {id:'oasealrecord_download_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordDownload"/>:'},element: oasealrecordDownload}
                                     ], 
                                     
                                     /* [
                                         {label: {id:'oasealrecord_annexe_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAnnexe"/>:'}, element: dataGridAnn,colspan:3}
                                     ], */
                                      /* [
                                         {label: {id:'oasealrecord_capture_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordCapture"/>:'},element: dataGridCap,colspan:3}
                                     ], */
                                     [
                                         {label: {id:'oasealrecord_finalann_label',text: '<ctp:label key="oasealrecordFinalAnn"/>:'},element: dataGridFiles,colspan:3}
                                     ]];
                   }else if (type == '0107'){//带附件说明
                	itemval = [[
           					 {label: {id:'applyRemark_label',text: '<ctp:label key="applyRemark"/>:'},element: applyRemark,colspan:3}
           						] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_rectitle_label',text: '<ctp:label key="oaapplyrecordbasicRecTitle"/>:'},element: oaapplyrecordbasicRecTitle,colspan:3}
                                  ] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_apply_label',text: '<ctp:label key="oaapplyrecordbasicApply"/>:'},element: oaapplyrecordbasicApply},    
                                      {label: {id:'oaapplyrecordbasic_isfile_label',text: '<ctp:label key="oaapplyrecordbasicIsfile"/>:'},element: oaapplyrecordbasicIsfile}
                                  ] ,
                                  [
                                      {label: {id:'oaapplyrecordbasic_org_label',text: '<ctp:label key="oaapplyrecordbasicOrg"/>:'},element: oaapplyrecordbasicOrg},
                                      {label: {id:'oaapplyrecordbasic_appdate_label',text: '<ctp:label key="oaapplyrecordbasicAppDate"/>:'},element: oaapplyrecordbasicAppDate}
                                      //{label: {id:'oaapplyrecordbasic_status_label',text: '<ctp:label key="oaapplyrecordbasicStatus"/>:'},element: oaapplyrecordbasicStatus}
                                  ],
                                  [
                                      {label: {id:'oaapplyrecordbasic_comp_label',text: '<ctp:label key="oaapplyrecordbasicComp"/>:'},element: oaapplyrecordbasicComp}
                                  ],
                                  [
                                      {label: {id:'oaapplyrecordbasic_emergency_label',text: '<span style="color:red;">*</span><ctp:label key="oaapplyrecordbasicEmergency"/>:'},element: oaapplyrecordbasicEmergency},
                                      {label: {id:'oasealrecord_usage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUsage"/>:'},element: oasealrecordUsage}
                                  ],
                                  [
           	                        {label: {id:'oasealrecord_sealtype_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordSealType"/>:'},element: oasealrecordSealType}
           	                    	],
           	                 
                                  [
                                      {label: {id:'oasealrecord_content_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordContent"/>:'},element: oasealrecordContent,colspan:3}
                                  ],
                                  [
                                      {label: {id:'oasealrecord_acrosspage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAcrossPage"/>:'},element: oasealrecordAcrossPage},
                                      {label: {id:'oasealrecord_download_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordDownload"/>:'},element: oasealrecordDownload}
                                  ], 
                                  
                                  /* [
                                      {label: {id:'oasealrecord_annexe_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAnnexe"/>:'}, element: dataGridAnn,colspan:3}
                                  ], */
                                   /* [
                                      {label: {id:'oasealrecord_capture_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordCapture"/>:'},element: dataGridCap,colspan:3}
                                  ], */
                                  [{
                                      label: {
                                          id: 'label19', 
                                          text: '附件说明:'
                                      }, 
                                      colspan:3,
                                      element: content
                                  }] ,
                                  [
                                      {label: {id:'oasealrecord_finalann_label',text: '<ctp:label key="oasealrecordFinalAnn"/>:'},element: dataGridFiles,colspan:3}
                                  ]];
                  }else {//三 附件 初稿终稿  图片
			   		itemval = [[
								 {label: {id:'applyRemark_label',text: '<ctp:label key="applyRemark"/>:'},element: applyRemark,colspan:3}
									] ,
			                       [
			                           {label: {id:'oaapplyrecordbasic_rectitle_label',text: '<ctp:label key="oaapplyrecordbasicRecTitle"/>:'},element: oaapplyrecordbasicRecTitle,colspan:3}
			                       ] ,
			                       [
			                           {label: {id:'oaapplyrecordbasic_apply_label',text: '<ctp:label key="oaapplyrecordbasicApply"/>:'},element: oaapplyrecordbasicApply},    
			                           {label: {id:'oaapplyrecordbasic_isfile_label',text: '<ctp:label key="oaapplyrecordbasicIsfile"/>:'},element: oaapplyrecordbasicIsfile}
			                       ] ,
			                       [
			                           {label: {id:'oaapplyrecordbasic_org_label',text: '<ctp:label key="oaapplyrecordbasicOrg"/>:'},element: oaapplyrecordbasicOrg},
			                           {label: {id:'oaapplyrecordbasic_appdate_label',text: '<ctp:label key="oaapplyrecordbasicAppDate"/>:'},element: oaapplyrecordbasicAppDate}
			                           //{label: {id:'oaapplyrecordbasic_status_label',text: '<ctp:label key="oaapplyrecordbasicStatus"/>:'},element: oaapplyrecordbasicStatus}
			                       ],
			                       [
			                           {label: {id:'oaapplyrecordbasic_comp_label',text: '<ctp:label key="oaapplyrecordbasicComp"/>:'},element: oaapplyrecordbasicComp}
			                       ],
			                       [
			                           {label: {id:'oaapplyrecordbasic_emergency_label',text: '<span style="color:red;">*</span><ctp:label key="oaapplyrecordbasicEmergency"/>:'},element: oaapplyrecordbasicEmergency},
			                           {label: {id:'oasealrecord_usedate_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUseDate"/>:'},element: oasealrecordUseDate}
			                       ],
			                       [
			                           {label: {id:'oasealrecord_usage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordUsage"/>:'},element: oasealrecordUsage}
			                           
			                       ],
				                    [
										{label: {id:'oasealrecord_sealtype_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordSealType"/>:'},element: oasealrecordSealType}
					                    ],
			                       [
			                           {label: {id:'oasealrecord_content_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordContent"/>:'},element: oasealrecordContent,colspan:3}
			                       ],
			                       [
			                           {label: {id:'oasealrecord_acrosspage_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAcrossPage"/>:'},element: oasealrecordAcrossPage},
			                           {label: {id:'oasealrecord_download_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordDownload"/>:'},element: oasealrecordDownload}
			                       ],
			                        
			                       [
			                           {label: {id:'oasealrecord_annexe_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordAnnexe"/>:'}, element: dataGridAnn,colspan:3}
			                        ],
			                        [
			                           {label: {id:'oasealrecord_capture_label',text: '<span style="color:red;">*</span><ctp:label key="oasealrecordCapture"/>:'},element: dataGridCap,colspan:3}
			                       ],
			                       [
			                           {label: {id:'oasealrecord_finalann_label',text: '<ctp:label key="oasealrecordFinalAnn"/>:'},element: dataGridFiles,colspan:3}
			                       ]];
                } 

                //信息栅格
                sealrecordLayout = new ctp.ui.gridlayout({
                    id:'sealrecordLayout',                
                    cols: 2,
                    align: 'center',
                    defaults:{
                   	 align: 'center',
            			label: {width: '100%'},
           			element:{
           				//默认创建textfield组件
           				type: 'textfield',
           				//默认的组件自带属性,width设成'100%'或不传，则该组件和关联标签的宽度之和会占满所在的列
           				options:{width: '100%'}
           			}
                        			
            		 },
                    items: itemval
                    
                });

                ctpToolbar=new ctp.ui.toolbar({
     				id : 'ctpToolbar',			
                 	leftItems :[
         		        {
     						id : "saveButton1",
     		            	type : 'button',
     		            	text : '<ctp:label key="save"/>',//'保存',
     		           		icon : 'save',
     		            	onClick : sealrecordNewFormSave
         		        },
         		        {
     						id : "submitButton1",
     		            	type : 'button',
     		            	text : '<ctp:label key="submit"/>',//提交
     		           		icon : 'apply',
     		            	onClick : sealrecordNewFormSubmit
         		        }
         		        ]
     		    });
                
                //信息表单
                sealrecordForm = new ctp.form({
                    id: 'sealrecordForm',
                    width: '95%', //宽度
                    //validator:sealrecordValidator,
                    height: '95%', //高度
                    postType:'ajax',
                    ajaxPostParam:{success: sealrecordFormSucc}, 
                    items: [sealrecordLayout],
                    buttons: [{
                        id: 'saveButton',
                        text: '<ctp:label key="save"/>',//保存
                        icon:'save' ,
                        onClick: sealrecordNewFormSave
                        }, {
                        id: 'submitButton',
                        text: '<ctp:label key="submit"/>',//提交
                        icon:'apply' ,
                        onClick: sealrecordNewFormSubmit 
                        }/* , {
                        id: 'resetButton',
                        text: '<ctp:label key="reset"/>',//重置
                        icon:'reload' ,
                        onClick: sealrecordInfoReset 
                        }, {
                        id: 'returnButton',
                        text: '<ctp:label key="back"/>',//返回 
                        icon:'return',
                        onClick: goBack 
                        } */
                    ]
                });

                //信息面板
                 sealrecordPanel = new ctp.ui.panel({
                    id: 'sealrecordPanel',
                    title: '<ctp:label key="detail.title"/>',
                    bodyPadding: 0,
                    style:'border',
                    toolbar:ctpToolbar,
    	           	toolbarPos:'innertop',
                    items: [
                        sealrecordForm
                    ],
                    renderTo:'body'
                }); 
                 
                 formValidator = new ctp.validator(
     					{   id:"formValidator",
     						customRex: {
     							'testCustomRex1':{
     								isValidateEmpty:false,
     								regex:'^[0-9]+$',
     								alertText:'只允许输入整数'
     							},
     							'testCustomRex2':{
     								isValidateEmpty:false,
     								regex:'^\\d+(\\.\\d{1,2})?$',
     								alertText:'只允许输入最多两位小数的数字'
     							},
     							'testCustomRex3':{
     								isValidateEmpty:false,
     								regex:'^[1-12]+$',
     								alertText:'只允许输入1到12的整数'
     							},
     							'testCustomRex4':{
     								isValidateEmpty:false,
     								regex:'^[1-31]+$',
     								alertText:'只允许输入1到31的整数'
     							},
     							"mobilephone":{"regex":"(^0?[1][358][0-9]{9}$)","alertText":"* "+"Invalid mobilephone number, must be 11 or 12 digital".local()+"."},
     							"telephone":{"regex":"^(0[0-9]{2,3}-)?([2-9][0-9]{6,7})+(-[0-9]{1,4})?$","alertText":"* "+"Invalid Tel number.3 or 4 digit area-code(opt),and 7 or 8 digit Tel-number".local()+"."},
     							"email":{"regex":"^[a-zA-Z0-9_.-]+@([a-zA-Z0-9-]+.)+[a-zA-Z0-9]{2,4}$","alertText":"* "+"Invalid email address".local()+"."}	
     						}

     			 });//验证框架 
     			 formValidator.setTarget(validateArray);
     			 
     			 init();

           });
        
        </script>
    </head>
    <body>
        <ctp:form name="sealrecordForm" method="post" action="sealrecordmain.flowc" flowActionName="">
        	<input type="hidden" id="oaapplyrecordbasicRecId"  name="oaapplyrecordbasicRecId" value='<ctp:out name="oaapplyrecordbasicRecId"/>'/>
			<input type="hidden" id="oasealrecordSealId" name="oasealrecordSealId" value='<ctp:out name="oasealrecordSealId"/>'/>
			<input type="hidden" id="oaapplyrecordbasicAnnexeFlieLable" name="oaapplyrecordbasicAnnexeFlieLable" value=""/>
			<input type="hidden" id="oasealrecordAnnexeFlieLable" name="oasealrecordAnnexeFlieLable" value=""/>
			<input type="hidden" id="oasealrecordCaptureFlieLable" name="oasealrecordCaptureFlieLable" value=""/>
			<input type="hidden" id="oasealrecordCaptureFlieLable" name="oasealrecordCaptureFlieLable" value=""/>
			<input type="hidden" id="oaapplyrecordbasicAppType" name="oaapplyrecordbasicAppType" value='<ctp:out name="provType"/>'/>
			<input type="hidden"  name = "userId" id="userId" value='<ctp:out name="sessCtx.user.id"/>'/>
            <input type="hidden"  name = "language" id="language" value='<ctp:out name="sessCtx.Language"/>'/>
			
			
			
        </ctp:form>
        
        <ctp:form name="downloadForm" method="post" action="fileuploadnew.flowc" flowActionName="fileDownload">
			<input type="hidden" name="openType"  id="openType"/>
			<input type="hidden" name="fileName"  id="fileName"/>
			<input type="hidden" name="showFileName" id="showFileName"/>
        </ctp:form>
    </body>
</html>

<%--
    date        :
    modifyReason:
--%>
